import App from '../App'

const home = r => require.ensure([], () => r(require('../page/home/home')), 'home')
const my = r => require.ensure([], () => r(require('../page/my/my')), 'my')
const info = r => require.ensure([], () => r(require('../page/info/info')), 'info')
const activity = r => require.ensure([], () => r(require('../page/activity/activity')), 'activity')
const userInfo = r => require.ensure([], () => r(require('../page/userInfo/userInfo')), 'userInfo')

const teacher = r => require.ensure([], () => r(require('../page/teacher/teacher')), 'teacher')
const integral = r => require.ensure([], () => r(require('../page/integral/integral')), 'integral')
const classmates = r => require.ensure([], () => r(require('../page/classmates/classmates')), 'classmates')

const scholarship = r => require.ensure([], () => r(require('../page/scholarship/scholarship')), 'scholarship')
const incomeList = r => require.ensure([], () => r(require('../page/scholarship/incomeList')), 'incomeList')
const expendList = r => require.ensure([], () => r(require('../page/scholarship/expendList')), 'expendList')
const drawcash = r => require.ensure([], () => r(require('../page/scholarship/drawcash')), 'drawcash')


const record = r => require.ensure([], () => r(require('../page/record/record')), 'record')
const star = r => require.ensure([], () => r(require('../page/star/star')), 'star')
const upgrade = r => require.ensure([], () => r(require('../page/upgrade/upgrade')), 'upgrade')

const category = r => require.ensure([], () => r(require('../page/category/category')), 'category')
const course = r => require.ensure([], () => r(require('../page/course/course')), 'course')
const courseList = r => require.ensure([], () => r(require('../page/courseList/courseList')), 'courseList')
const courseAll = r => require.ensure([], () => r(require('../page/courseAll/courseAll')), 'courseAll')
const community = r => require.ensure([], () => r(require('../page/community/community')), 'community')
const orderList = r => require.ensure([], () => r(require('../page/orderList/orderList')), 'orderList')
const integralList = r => require.ensure([], () => r(require('../page/integralList/integralList')), 'integralList')
const integralRecord = r => require.ensure([], () => r(require('../page/integralRecord/integralRecord')), 'integralRecord')
const signIn = r => require.ensure([], () => r(require('../page/signIn/signIn')), 'signIn')
const albumAll = r => require.ensure([], () => r(require('../page/albumAll/albumAll')), 'albumAll')

export default [{
    path: '/',
    component: App, //顶层路由，对应index.html
    children: [ //二级路由。对应App.vue
        //地址为空时跳转home页面
        {
            path: '',
            redirect: '/home'
        },
        //首页
        {
            path: '/home',
            component: home
        },
        //我的
        {
            path: '/my',
            component: my
        },
        //消息
        {
            path: '/info',
            component: info
        },
        //活动
        {
            path: '/activity',
            component: activity
        },
        //用户信息
        {
            path: '/userInfo',
            component: userInfo
        },

        //班主任
        {
            path: '/teacher',
            component: teacher
        },

        //积分
        {
            path: '/integral',
            component: integral
        },

        //同学
        {
            path: '/classmates',
            component: classmates
        },
        //奖学金
        {
            path: '/scholarship',
            component: scholarship
        }, 
        //提现
        {
            path: '/drawcash',
            component: drawcash
        },        
        //收入明细
        {
            path: '/incomeList',
            component: incomeList
        },
        //消费记录
        {
            path: '/expendList',
            component: expendList
        },
        //记录
        {
            path: '/record',
            component: record
        },
        //关注公众号
        {
            path: '/star',
            component: star
        },
        //升级会员
        {
            path: '/upgrade',
            component: upgrade
        },
        //分类
        {
            path: '/category/:index',
            name: 'category',
            component: category
        },
        //课程
        {
            path: '/course/:id',
            name: 'course',
            component: course
        },
        //课程
        {
            path: '/courseList/:id',
            name: 'courseList',
            component: courseList
        },
        //所有课程
        {
            path: '/courseAll',
            component: courseAll
        },
        //社群
        {
            path: '/community',
            component: community
        },
        //社群
        {
            path: '/orderList',
            component: orderList
        },
        //积分排行榜
        {
            path: '/integralList',
            component: integralList
        },
        //积分记录
        {
            path: '/integralRecord',
            component: integralRecord
        },
        //签到
        {
            path: '/signIn',
            component: signIn
        },
        //专栏目录
        {
            path: '/albumAll',
            component: albumAll
        },

    ]
}]